__auther__ = "YaoJiaWen";

import re;

# 输入输出
# s=input();
# print(s);

# 数据类型
a = 231;
print("a的值是 %d,其类型是 %s" % (a, type(a)))

a = 231.442;
print("a的值是 %f,其类型是 %s" % (a, type(a)))

a = True;
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = 4 + 3j;
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = "abcdefg";
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = ["csda", True, 12, 12];
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = ("csda", True, 12, 12);
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = {"name": "yjw", "age": 18};
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = {"name", "age", "age"};
print("a的值是 %s,其类型是 %s" % (a, type(a)))

a = None;
print("a的值是 %s,其类型是 %s" % (a, type(a)))

# 运算符
print((34 + 22.33) / 3);
print(5 % 2);
print(5 // 2);
print(True and True);
print(True or False);
print(not False);

# ASCII
print(ord("a"));
print(chr(98));

# encode &&decode
print("cdsac".encode("ASCII"));
print("中文".encode("utf-8"));
print(b'cdsac'.decode("ASCII"));

# string
# "格式化模板“ % （args）:模板使用%？ 进行占位，元祖元素使用占位符
print("Hi %s 你好" % ("yjw,"));
print("%s同学你好，在%02d学期，你的成绩是%.2f,提升了%.2f%%" % ("yjw", 2, 87.237567, 1.12345));
print(len("abcds"));
print(len("中文"));
print(len("中文".encode("utf-8")));

#正则表达式
print(re.match("a","yjw"));
print(re.search("a","yjw"));
#截止五月九日，新冠病毒确诊人数234例（其中海外输入77例），累计治愈456例，死亡四例，住院观察56例
pa="新冠病毒确诊人数(\d+)例（其中海外输入(\d+)例），累计治愈(\d+)例，死亡(\d+)例，住院观察(\d+)例";
ta="新冠病毒确诊人数234例（其中海外输入77例），累计治愈456例，死亡4例，住院观察56例";
ma=re.search(pa, ta);
if ma:
    print(ma.groups());
    print(ma.group(0));
    print(ma.group(1));
    print(ma.group(2));
pa='<link rel="canonicacl" href="(.*?)"/>';
#ta=


#list
l=["dsa",32,34.44,None,True,32];
print(l);
l=list(range(1,10));
print(l);
l=list("index_%d"% i for i in range(1,11));
print(l);
l=list("http://www.sfac.xyz/library/novel/%d" % i for i in range(1,11));
print(l);
l=list(range(1,10));
print(l);
l.append(10);
print(l);
l.pop();
print(l);
l.pop(0);
print(l);
l.remove(9);
print(l);
l2=["cdas",33];
l+=l2;
print(l);
print(l[0]);

#tuple
t=tuple(range(1,10));
print(t);
t=("dsa",32,34,44,None,True,32,["yjw","cdascda"]);
print(t);
t[7][0]="yj";
print(t);

#dict
d={"name":"yjw","age":18,"gender":"female"};
print(d);
print(d.keys());
print(d.values());
print(d["name"]);
print(d.get("name1","aaa"));
d["aaa"]="bbb";
print(d);
d2={"ccc":"ddd","eee":"fff"};
print(dict(d,**d2));
d.pop("aaa");
print(d);

#set
s={"name","age","gender"};
print(s);
s=set(list(range(1,10)));
print(s);
s.pop();
print(s);
s.remove(8);
print(s);

#判断语句，循环语句
age=19;
if age<=18:
    print("青年");
elif age>18 and age <=60:
    print("中年");
else:
    print("老年");

l=list(range(1,10));
for i in l:
    print(i);

i=0;
while i<10:
    print(i);
    i=i+1;

a="study" if age <=18 else "work";
print(a);

#变量
_a="cdsacdas";
__a="cdscda";
HUMAN_NAME="cdacdas";

